From 797df688295c3a2b722cf9bc5d1c575a257645b4 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Sun, 26 Feb 2006 10:42:07 +0100 Subject: [PATCH] Cross-compilation fixes (x86/64 on i386). Use strtoull to parse the final_exec_addr value from the command line. Whe cross compiling on i386 for x86-64 unsigned long is 32 bit, which leads to final_exec_addr being truncated to 32 bits by strtoul, which leads to grub refusing to load the resulting image. Please apply. Use the target nm(1) when cross compiling to pick the _end address from the Xen binary. Signed-Off-By: Muli Ben-Yehuda --- xen/arch/x86/Makefile | 2 +- xen/arch/x86/boot/mkelf32.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile index 854427293b..8e93283588 100644 --- a/xen/arch/x86/Makefile +++ b/xen/arch/x86/Makefile @@ -44,7 +44,7 @@ default: $(TARGET) $(TARGET): $(TARGET)-syms boot/mkelf32 ./boot/mkelf32 $(TARGET)-syms $(TARGET) 0x100000 \ - `nm $(TARGET)-syms | sort | tail -n 1 | sed -e 's/^\([^ ]*\).*/0x\1/'` + `$(NM) $(TARGET)-syms | sort | tail -n 1 | sed -e 's/^\([^ ]*\).*/0x\1/'` $(CURDIR)/arch.o: $(OBJS) $(LD) $(LDFLAGS) -r -o $@ $(OBJS) diff --git a/xen/arch/x86/boot/mkelf32.c b/xen/arch/x86/boot/mkelf32.c index e93dfdcf96..476a86374d 100644 --- a/xen/arch/x86/boot/mkelf32.c +++ b/xen/arch/x86/boot/mkelf32.c @@ -244,7 +244,7 @@ int main(int argc, char **argv) inimage = argv[1]; outimage = argv[2]; - loadbase = strtoul(argv[3], NULL, 16); + loadbase = strtoull(argv[3], NULL, 16); final_exec_addr = strtoul(argv[4], NULL, 16); infd = open(inimage, O_RDONLY); -- 2.30.2